#define _CRT_SECURE_NO_WARNINGS 1


#include<stdio.h>
#include<string.h>

int counter = 0;         

void Sort(char c[][100]) {
    int i, j;
    char temp[100];
    int flag = 1;        
    int n = counter;
    int last = 0;
    while (flag == 1) {
        flag = 0;
        for (i = 0; i < n - 1; i++) {
            j = i + 1;
            if (strcmp(c[i], c[j]) > 0) {
                strcpy(temp, c[i]);
                strcpy(c[i], c[j]);
                strcpy(c[j], temp);
                flag = 1;
                last = j;
            }
        }
        n = last;  
    }
}
void main() {
    int i = 0;
    char c[100][100];
    while (gets(c[i]) != NULL) {
        i++;
        if (i == 5)break;
    }
    counter = i;    
    Sort(c);
    for (i = 0; i < counter; i++) {
        printf("\n");
        puts(c[i]);
    }
}

